<template>
  <div class="home">
    <div class="el-container">
      <!--      <div class="header-page">
        &lt;!&ndash; 左边的logo &ndash;&gt;
        <div class="header-logo">
          <span>Blink</span>
        </div>
        &lt;!&ndash; 中间的菜单 &ndash;&gt;
        <div class="header-menu">
        <a>首页</a>
        </div>
        &lt;!&ndash; 右边的按钮 &ndash;&gt;
        <div class="header-btn">
          <button type="button" class="el-button" @click="startUse()">
            <span>{{choose}}</span>
          </button>
        </div>
        </div>-->
      <!-- main -->
      <div class="main-page">
        <div id="back-box" class="back-box"></div>
        <div class="content-page">
          <!-- 左边的文字 -->
          <div class="content-explain">
            <h1 class="title1">更小 更轻 的问卷系统</h1>
            <h1 class="title2">Blink - Smaller Lighter and Better</h1>
            <div class="button-use">
              <el-button type="primary" round @click="startUse">开始使用</el-button>
            </div>
          </div>
          <!-- 右边的图片 -->
          <!--            <div class="img-wrapper">
              <img src="../img/runner.svg">
            </div>-->
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Home",
  data() {
    return {
      choose: "登录"
    };
  },
  created: function() {
    console.log("hahaha");
    if (this.$store.state.isLogin) {
      this.choose = "控制台";
    }
  },
  methods: {
    startUse() {
      if (this.$store.state.isLogin) {
        this.$router.replace("/manage");
      } else {
        this.$router.replace("/login");
      }
    }
  }
};
</script>
<style scoped>
html {
  overflow: hidden;
}
.home {
  width: 100%;
  background-image: url("../assets/background_home.jpg");
  background-size: cover;
  background-position: center;
  overflow: visible;
}
.el-container {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  margin-top: -60px;
}
.header-page {
  -webkit-animation: slide-in-top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation: slide-in-top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  height: 100px;
  line-height: 100px;
  position: absolute;
  width: 100%;
  top: 0px;
  z-index: 100;
  padding: 0px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  width: 150px;
  line-height: 64px;
  margin-left: 30px;
}
.header-logo span {
  font-size: 50px;
  color: white;
}
.header-menu {
  width: 50%;
  display: flex;
}
.header-menu a {
  font-weight: 400;
  font-size: 30px;
  color: #fff;
  padding: 0 20px;
}
.header-btn {
  margin-right: 30px;
}
.main-page {
  width: 100%;
  /* height: 100%; */
  overflow: hidden;
  position: relative;
}
/*#back-box{
  color: #fff;
  box-sizing: border-box;
  position: absolute;
  top: -100vh;
  left: -100px;
  width: 150vw;
  height: 150vh;
  border-radius: 0 280px;
  transform: rotate(-22deg);
  background: linear-gradient(60deg,#1e53f4,#1e53f4,#30cffd,#30cffd,#30cffd);
  }*/
.content-page {
  height: 225px;
  color: #fff;
  margin-top: 64px;
  max-width: 100%;
  margin: auto 0;
  padding: 24px;
  display: flex;
  position: relative;
}
.content-explain {
  z-index: 1;
  position: absolute;
  top: 80%;
  width: 50%;
  height: 263px;
  left: 0;
  right: 0;
  margin: 0 auto;
}
.content-explain .title1 {
  height: 100px;
  line-height: 100px;
  font-size: 70px;
  transition-timing-function: ease;
  margin-bottom: 30px;
  -webkit-animation: slide-in-bottom 1s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    both;
  animation: slide-in-bottom 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.content-explain .title2 {
  height: 100px;
  line-height: 100px;
  font-size: 35px;
  /* margin-top: 70px; */
  -webkit-animation: slide-in-bottom 1s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    both;
  animation: slide-in-bottom 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.content-explain .button-use {
  /* background-color: red; */
  /* color: blue; */
  width: 200px;
  margin-bottom: 0;
  margin-top: 50px;
  /*margin-left: 200px;*/
  -webkit-animation: slide-in-bottom 1s cubic-bezier(0.25, 0.46, 0.45, 0.94)
    both;
  animation: slide-in-bottom 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.button-use .el-button--primary {
  width: 150px;
  background-color: white;
  border: transparent;
  color: #3a86ff;
  height: 60px;
  font-size: 20px;
  transition: all 0.3s;
  margin-left: 284px;
  /* border-radius: 20%; */
}
.button-use .el-button--primary:hover {
  background-color: #ecf5ff;
  margin-top: -10px;
}
.img-wrapper {
  /* background-color: black; */
  position: absolute;
  top: 70%;
  right: 0;
  width: 50%;
  -webkit-animation: slide-in-br 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
  animation: slide-in-br 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.img-wrapper img {
  width: 100%;
}
@-webkit-keyframes slide-in-bottom {
  0% {
    -webkit-transform: translateY(1000px);
    transform: translateY(1000px);
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}
/* 从上面浮出来动画 */
/* ----------------------------------------------
 * Generated by Animista on 2021-8-21 16:23:6
 * Licensed under FreeBSD License.
 * See http://animista.net/license for more info. 
 * w: http://animista.net, t: @cssanimista
 * ---------------------------------------------- */

/**
 * ----------------------------------------
 * animation slide-in-top
 * ----------------------------------------
 */
@-webkit-keyframes slide-in-top {
  0% {
    -webkit-transform: translateY(-1000px);
    transform: translateY(-1000px);
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slide-in-top {
  0% {
    -webkit-transform: translateY(-1000px);
    transform: translateY(-1000px);
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}
/* 从底下浮上来动画 */
@keyframes slide-in-bottom {
  0% {
    -webkit-transform: translateY(1000px);
    transform: translateY(1000px);
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
  }
}
/* 从右下角进入动画 */
@-webkit-keyframes slide-in-br {
  0% {
    -webkit-transform: translateY(1000px) translateX(1000px);
    transform: translateY(1000px) translateX(1000px);
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0) translateX(0);
    transform: translateY(0) translateX(0);
    opacity: 1;
  }
}
@keyframes slide-in-br {
  0% {
    -webkit-transform: translateY(1000px) translateX(1000px);
    transform: translateY(1000px) translateX(1000px);
    opacity: 0;
  }
  100% {
    -webkit-transform: translateY(0) translateX(0);
    transform: translateY(0) translateX(0);
    opacity: 1;
  }
}
</style>


